package com.example.vocab.service.impl;

import com.example.vocab.dao.HistoryDao;
import com.example.vocab.entity.History;
import com.example.vocab.service.HistoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class HistoryServiceImpl implements HistoryService {

    @Autowired
    HistoryDao historyDao;

    @Override
    public List<History> getHistory(String username) {
        List<History> history = historyDao.getHistory(username);
        return history;
    }

    @Override
    public int addHistory(String username, int score,String time) {
        int i = historyDao.addHistory(username, score,time);
        return i;
    }

    @Override
    public List<History> getChart() {
        List<History> users = historyDao.getRank();
        return users;
    }


}
